<template>
  <div>
    <pulldown header="帮教计划">
      <div slot="content">
        <record ref="record"></record>
      </div>
    </pulldown>
    <pulldown header="小组成员">
      <div slot="content">
        <groupRecord ref="groupRecord"></groupRecord>
      </div>
    </pulldown>
    <pulldown header="小组成员变动">
      <div slot="content">
        <a-table :columns="columns" :data-source="forData">

        </a-table>
      </div>
    </pulldown>
    <!--    {{$filterDictTextByCache('process_approval_type', 1)}}-->
  </div>
</template>

<script>
import pulldown from '../../modules/pulldown'
import record from './record'
import groupRecord from './groupRecord'
import {holoArchivePlan} from "@api/sjsk/archives";
export default {
  name: "basic",
  components:{ pulldown,record,groupRecord },
  mounted() {
  },
  data(){
    return   {
      columns:[
        {
          title: '序号',
          dataIndex: 'age',
          key: 'age',
        },
        {
          title: '更新时间',
          dataIndex: 'updateTime',
          key: 'updateTime',
        },
        {
          title: '内容',
          key: 'content',
          dataIndex: 'content',
          scopedSlots: { customRender: 'content' },
        },
      ],
      forData:[]
    }
  },
  methods:{
    refreshTable(){
      console.log('计划')
      this.$refs.record.refreshTable('1607279730774003712','1')
      this.$refs.groupRecord.refreshTable('123','1')
      let queryObj = {
        id: '1',
        type: '1'
      }
      this.refreshTable1(queryObj)
    },
    refreshTable1(queryObj){
      holoArchivePlan(queryObj).then(ser => {
        if(ser.success){
          let age = 0
          this.forData = ser.result.sjskPersonChangeRecordVOS
          for(let item of this.forData){
            age++
            item.age = age
          }
          console.log(this.forData)
        } else {
          this.$message.error(ser.message)
        }
      }).catch(err => {

      })
    }
  }
}
</script>

<style scoped>

</style>